package com.yby6.common.utils;

import lombok.extern.slf4j.Slf4j;
import org.jasypt.util.text.BasicTextEncryptor;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: yangbuyi-rbac
 * @ClassName: BasicTextEncryptorUtils
 * @create: 2021-05-11 11:45
 * @author: yangshuai
 * @since： JDK1.8
 * @BasicTextEncryptorUtils: yml$配置文件加密
 **/

public class BasicTextEncryptorUtils {

	public static void main(String[] args) {
		BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
		//加密所需的salt(盐)
		textEncryptor.setPassword("yangbuyi");
		//要加密的数据（数据库的用户名或密码）
		String username = textEncryptor.encrypt("root");
		String password = textEncryptor.encrypt("123456");
		System.out.println("username:"+username);
		System.out.println("password:"+password);
	}

}
